import axios from "@/utils/request";

export const getRoleList = () => {
  return axios.get("/roles");
};
export const addRole = (params) => {
  return axios.post("/roles", params);
};
export const setrole = (id, params) => {
  return axios.put(`/roles/${id}`, params);
};
export const deleterole = (id) => {
  return axios.delete(`/roles/${id}`);
};
export const getAllList = (type) => {
  return axios.get(`rights/${type}`);
};
export const setUserrole = (id, params) => {
  return axios.post(`roles/${id}/rights`, { rids: params });
};

export const deleteChoicerole = (id, rightId) => {
  return axios.delete(`roles/${id}/rights/${rightId}`);
};
